"""meiduo_mall URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from apps.users import views

urlpatterns = [
    # 1. 用户注册页面的类视图
    url(r'^register/$', views.RegisterView.as_view(),name='register'),

    # 2. 判断用户名是否重复 usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$',views.UsernameCountView.as_view(),name='usernamecount'),

    # 3. 判断手机号是否重复 mobiles/(?P<mobile>1[3-9]\d{9})/count/
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view(), name='mobilecount'),

    # 4. 用户登录页面的类视图
    url(r'^login/$', views.LoginView.as_view(), name='login'),

    # 5. 用户退出的类视图
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),

    # 6. 用户中心的类视图
    url(r'^info/$', views.UserInfoView.as_view(), name='info'),

    # 7. 用户中心的类视图
    url(r'^emails/$', views.EmailView.as_view(), name='email'),

    # 8. 用户中心的类视图
    url(r'^emails/verification/$', views.VerifyEmailView.as_view(), name='verifyemail'),

    # 9. 用户收货地址
    url(r'^address/$', views.AddressView.as_view(), name='address'),

    # 10. 新增用户收货地址
    url(r'^address/create/$', views.CreateAddressView.as_view(), name='createaddress'),

    # 11. 用户浏览记录
    url(r'^browse_histories/$', views.UserBrowseHistory.as_view(), name='history'),

]
